import { createRouter, createWebHistory } from 'vue-router'
import FirstPage from '@/views/FirstPage.vue'
import Header from '@/views/Header.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: FirstPage,
    },
    {
      path: '/login',
      component: () => import('../views/Login.vue')
    },
    {
      path: '/register',
      component: () => import('../views/Register.vue')
    },
    {
      path: '/',
      component: Header,
      children:[
        {
          path:'index',
          component:()=> import('../views/Index.vue')
        },
        {
          path:'post',
          component:()=> import('../views/Post.vue')
        },
        {
          path:'message',
          component:()=> import('../views/Message.vue')
        },
        {
          path:'content',
          component:()=> import('../views/Content.vue')
        },
        {
          path:'my-home-page',
          component:()=> import('../views/MyHomePage.vue')
        },
        {
          path:'edit',
          component:()=> import('../views/Edit.vue')
        },
        {
          path:'manage',
          component:()=> import('../views/manage/Manage.vue'),
          children:[
            {
              path:'user-manage',
              component:()=> import('../views/manage/UserManage.vue')
            },
            {
              path:'post-check',
              component:()=> import('../views/manage/PostCheck.vue')
            },
            {
              path:'post-modify',
              component:()=> import('../views/manage/PostModify.vue')
            }
          ]
        }
      ]
    }
  ]
})

export default router
